package cn.stylefeng.guns.modular.scheduling;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import cn.stylefeng.guns.modular.entity.IdjUser;
import cn.stylefeng.guns.modular.service.IIdjUserService;

@Component
public class UserTask {

	@Autowired
	private IIdjUserService service;

	@Scheduled(cron = "0 0 01 * * ?")
	public void userTask() {
		System.out.println("========================================定时任务已开启========================================");
		List<Long> list = service.selectUnsealUser();
		for (int i = 0; i < list.size(); i++) {
			IdjUser user = new IdjUser();
			user.setUserId(list.get(i));
			user.setTitleStatus("0");
			service.setStatus(user);
		}
	}
	
}
